import request from "@/utils/request.js"
const FileById = request.FileById;
const upload = (data)=>{
	return request.upload(data)
}
const getByMyself = ()=>{
	return request.get('/User/GetUserByMyself')
}

const getPhotographByMyself = ()=>{
	return request.get('/Photograph/GetByMyself')
}

const  getDimensionsById = async (id)=>{
	return await request.get('/File/GetDimensionsById?id='+id)
}

const getLikeByUser = ()=>{
	return request.get('/like/getbyselect?pageIndex=1&pageSize=1000')
}
const addStar = (data)=>{
	return request.post('/star/add',data)
}
const getStar = ()=>{
	return request.get('/star/GetBySelect')
}
const getStarItem = (starId)=>{
	return request.get('/starItem/GetStarItemByStarId?starId='+starId)
}
const getStarById = (id)=>{
	return request.get('/star/getbyid?id='+id)
}

const getUserById = (id)=>{
	return request.get('/User/GetById?id='+id)
}

const getPhotographByUserId = (id)=>{
	return request.get('/Photograph/GetPhotographByUserId?userId='+id)
}
const getStarByUserId = (userId)=>{
	return request.get('/star/GetBySelect?extendedValue1='+userId)
}

const getLikesByUserId = (userId)=>{
	return request.get('/Like/GetBySelect?extendedValue1='+userId)
}
const updateAvatar = (data)=>{
	return request.post('/User/UpdateAvatar',data)
}

const updateUser = (data)=>{
	return request.post('/User/Update',data)
}
const addConversation = (data)=>{
	return request.post('/Conversation/Add',data)
}

const getFollows = (id)=>{
	return request.get("/Follow/GetFollowingList?userId="+id)
}

const getFans = (id)=>{
	return request.get("/Follow/GetFansList?userId="+id)
}
const unFollow = (id)=>{
	return request.del('/Follow/UnFollow?followerId='+id)
}
const follow = (id)=>{
	return request.post('/Follow/Add',{followerId:id})
}
export default{
	unFollow,
	follow,
	getFollows,
	getFans,
	addConversation,
	updateUser,
	updateAvatar,
	getLikesByUserId,
	getStarByUserId,
	getPhotographByUserId,
	getUserById,
	getStarById,
	getStarItem,
	getStar,
	addStar,
	getLikeByUser,
	FileById,
	upload,
	getByMyself,
	getPhotographByMyself,
	getDimensionsById
	
}